﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminFunction.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="BitPortal.Admin.Service.Product.Default1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .x-grid3-cell-inner
        {
            font-family: "segoe ui" ,tahoma, arial, sans-serif;
        }
        
        .x-grid-group-hd div
        {
            font-family: "segoe ui" ,tahoma, arial, sans-serif;
        }
        
        .x-grid3-hd-inner
        {
            font-family: "segoe ui" ,tahoma, arial, sans-serif;
            font-size: 12px;
        }
        
        .x-grid3-body .x-grid3-td-Cost
        {
            background-color: #f1f2f4;
        }
        
        .x-grid3-summary-row .x-grid3-td-Cost
        {
            background-color: #e1e2e4;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="TopBarHolder" runat="server">
    <ext:Toolbar ID="Toolbar1" runat="server">
        <Items>
            <ext:Button runat="server" ID="btnAdd" Text="Thêm lỗi" Icon="PageAdd" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnAdd_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:ToolbarSeparator />
            <ext:Button runat="server" ID="btnViewAllError" Text="Xem tất cả lỗi " Icon="Pencil" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnViewAllError_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:ToolbarSeparator />
          
            
            
            <ext:SplitButton runat="server" ID="btnTrash" Text="Thùng rác" Icon="Bin" Scale="Medium">
                <Menu>
                    <ext:Menu ID="Menu2" runat="server">
                        <Items>
                            <ext:MenuItem ID="MenuItem8" runat="server" Text="Xóa tất cả" Icon="Cancel">
                                <DirectEvents>
                                    <Click OnEvent="btnTrashEmpty_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="MenuItem9" runat="server" Text="Xóa những bài được chọn" Icon="BinEmpty">
                                <DirectEvents>
                                    <Click OnEvent="btnTrashDelete_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="MenuItem10" runat="server" Text="Bỏ khỏi thùng rác" Icon="ArrowTurnLeft">
                                <DirectEvents>
                                    <Click OnEvent="btnUnDelete_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                        </Items>
                    </ext:Menu>
                </Menu>
                <DirectEvents>
                    <Click OnEvent="btnTrash_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:SplitButton>
        </Items>
    </ext:Toolbar>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData" RemoteSort="true" RemotePaging="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="ProductCustomerId">
                <Fields>
                    <ext:RecordField Name="ProductCustomerId" Type="Int" />
                    <ext:RecordField Name="CustomerID" Type="Int" />
                    <ext:RecordField Name="ProductID" Type="Int" />
                    <ext:RecordField Name="CountProduct" Type="Int" />
                    <ext:RecordField Name="CountError" Type="Int" />
                    <ext:RecordField Name="DateBuy" Type="Date" />
                    <ext:RecordField Name="ProductCost" Type="Float" />
                    <ext:RecordField Name="StateProduct" Type="Int" />
                    
                    <ext:RecordField Name="Product_Name" Type="String" ServerMapping="Product.Name"  />
              
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="10" Mode="Raw" />
            <ext:Parameter Name="sort" Value="" />
            <ext:Parameter Name="dir" Value="" />
        </BaseParams>
        <SortInfo Field="ProductCustomerId" Direction="DESC" />
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" Title="Danh sách sản phẩm"
        StoreID="Store1">
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:ImageCommandColumn Header="" Align="Center" Width="25" Resizable="false">
                    <Commands>
                        <ext:ImageCommand CommandName="MyCommand" Icon="Note" ToolTip-Text="Xem lỗi">
                        </ext:ImageCommand>
                    </Commands>
                </ext:ImageCommandColumn>
                <ext:Column Header="Mã" DataIndex="ProductCustomerId" Groupable="false" />
                <ext:Column Header="Tên sản phẩm" DataIndex="Product_Name" Groupable="false" />
                 <ext:TemplateColumn Header="Ảnh" Groupable="false" Sortable="false">
                    <Template ID="Template1" runat="server">
                        <Html>
                            <img src="/Handlers/Thumbnail.ashx?p={ThumbImage}&w=80&h=60" width="80" height="60"
                                alt="" />
                        </Html>
                    </Template>
                </ext:TemplateColumn>
                
                <ext:Column Header="Số lượng" DataIndex="CountProduct" Groupable="false" Align="Center" />
                <ext:DateColumn Header="Ngày mua" DataIndex="DateBuy" Groupable="false" Align="Center" Format="dd-MM-yyyy"/>
                <ext:Column Header="Số lượng lỗi" DataIndex="CountError" Groupable="false" />
                <ext:Column Header="Giá sản phẩm" DataIndex="ProductCost" Groupable="false" />
             
            </Columns>
        </ColumnModel>
        <Listeners>
            <Command Handler="Ext.net.DirectMethods.LoadNotes(record.data.ProductCustomerId);" />
        </Listeners>
        <SelectionModel>
            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
        </SelectionModel>
        <View>
            <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                ShowGroupName="true" EnableNoGroups="true" HideGroupedColumn="true" ShowGroupsText="Nhóm lại theo cột này" />
        </View>
        <LoadMask ShowMask="true" />
        <Plugins>
            <ext:GridFilters runat="server" ID="GridFilters1">
                <Filters>
                    <ext:NumericFilter DataIndex="ProductCustomerId" />
                    <ext:NumericFilter DataIndex="CountError" />
                    <ext:NumericFilter DataIndex="ProductCost" />
                    <ext:NumericFilter DataIndex="CountProduct" />
                    <ext:DateFilter DataIndex="DateBuy">
                        <DatePickerOptions runat="server" TodayText="Now" />
                    </ext:DateFilter>
                </Filters>
            </ext:GridFilters>
            <ext:RowExpander ID="RowExpander1" runat="server">
                <Template ID="Template2" runat="server">
                    <Html>
                        <div style="padding: 10px; line-height: 1.5em">
							
                        </div>
                    </Html>
                </Template>
            </ext:RowExpander>
        </Plugins>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" />
        </BottomBar>
    </ext:GridPanel>
    <uc:ErrorAddEdit ID="errorAddEdit1" runat="Server" ReloadGrid="GridPanel1" />
    <ext:Window ID="wProductNotes" runat="server" Collapsible="true" Icon="Note" Title="Notes"
        Width="960" Height="500" AutoScroll="true" Hidden="true" ButtonAlign="Center"
        AutoDataBind="false" Modal="true" Maximizable="true">
        <AutoLoad ShowMask="true" Mode="IFrame" />
    </ext:Window>
   <%-- <uc:ErrorList runat="Server" ID="errorList1"></uc:ErrorList>--%>

    <ext:Window ID="wProductError" runat="Server" Collapsible="true" Icon="Error" Title="Errors"
        Width="960" Height="500" AutoScroll="true" Hidden="true" ButtonAlign="Center" AutoDataBind="false" Modal="true" Maximizable="true">
        <AutoLoad ShowMask="true" Mode="IFrame"/>    
    </ext:Window>
</asp:Content>
